package vn.co.thn.android.videohot.adapter;

import java.util.ArrayList;
import java.util.List;

import vn.co.thn.android.videohot.R;
import vn.co.thn.android.videohot.VHUrlApi;
import vn.co.thn.android.videohot.fragment.VHVideoListFragment;
import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

public class VHTimeLinePagerAdapter extends FragmentPagerAdapter {
	List<VHVideoListFragment> mListPage;
	private Context context;
	public VHTimeLinePagerAdapter(FragmentManager fm,Context mContext) {
		super(fm);
		context=mContext;
		mListPage = new ArrayList<VHVideoListFragment>();
		mListPage.add(VHVideoListFragment.newInstance(VHUrlApi.Api_Video_new));
		mListPage.add(VHVideoListFragment.newInstance(VHUrlApi.Api_Video_List_review));
		mListPage.add(VHVideoListFragment.newInstance(VHUrlApi.Api_Video_List_like));
	}

	@Override
	public Fragment getItem(int arg0) {
		// TODO Auto-generated method stub
		return mListPage.get(arg0);
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return mListPage.size();
	}

	@Override
	public CharSequence getPageTitle(int position) {
		switch (position) {
		case 0:
			return  context.getString(R.string.text_new);
		case 1:
			return context.getString(R.string.text_review);
		case 2:
			return context.getString(R.string.text_like);
		}
		return "";
	}
}
